import React from "react";
import { Tooltip, Button } from "antd";

interface IWithTooltipBtnProps {
    message: string | React.ReactNode;  // tooltip显示文本
    btnExtra?: {[key: string]: any};  // btn的配置
}

const WithTooltipBtn: React.FC<IWithTooltipBtnProps> = (props) => {
    const { children, message, btnExtra } = props;
    return <Tooltip
        title={message}
    >
        <Button {...btnExtra}>{children}</Button>
    </Tooltip>
}

export default WithTooltipBtn;